From: Keir Fraser Date: Sun, 2 Aug 2009 11:26:23 +0000 (+0100) Subject: xend: save/restore cpu_weight and cpu_cap X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13535 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=2707e9adc1b265b60e1cac27cc96c32658675518;p=xen.git xend: save/restore cpu_weight and cpu_cap This patch allows vcpus_params cpu_weight and cpu_cap to be saved and restored. Most the code to support this already existed, but the save path needed to be updated to explicitly save these params, and the restore path needed to be updated to resend the params down to the kernel. From: Andrew Jones Signed-off-by: Keir Fraser --- diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 9ef008c54e..edb6a2fe32 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -1088,6 +1088,10 @@ class XendConfig(dict): if self.has_key(legacy) and self[legacy] not in (None, []): sxpr.append([legacy, self[legacy]]) + if self.has_key('vcpus_params'): + sxpr.append(['cpu_weight', int(self['vcpus_params'].get('weight', 256))]) + sxpr.append(['cpu_cap', int(self['vcpus_params'].get('cap', 0))]) + if self.has_key('security_label'): sxpr.append(['security_label', self['security_label']]) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index b505a3d86e..2350cb7d18 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -2448,6 +2448,8 @@ class XendDomainInfo: raise VmError("Cpu cap out of range, valid range is from 0 to %s for specified number of vcpus" % (self.getVCpuCount() * 100)) + xc.sched_credit_domain_set(self.domid, weight, cap) + # Test whether the devices can be assigned with VT-d self.info.update_platform_pci() pci = self.info["platform"].get("pci")